package com.example.demo.dao;

import com.example.demo.domain.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * Created by lisen on 2017/6/30.
 */
@Mapper
public interface UserMapper {
    @Select("SELECT * FROM USER WHERE name=#{name}")
    User findByName(@Param("name") String name);

    @Insert("INSERT INTO USER(name,age) VALUES(#{name},#{age})")
    int insert(@Param("name") String name, @Param("age") Integer age);
}
